﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WarOfDev.Web.Models;
using WarOfDev.EF;

namespace WarOfDev.Web.ViewModels.MappingToModel
{
    public static class DeveloperMapping
    {
        public static Developer ToModel(this DeveloperViewModel vm)
        {
            Developer model = new Developer();

            model.Id = vm.Id;
            model.ExperienceValue = vm.ExperienceValue;
            model.DomainAccount = vm.DomainAccount;
            model.TrueName = vm.TrueName;
            model.NickName = vm.NickName;
            model.GameLevel = vm.GameLevel;
            model.CreatedBy = vm.CreatedBy;
            model.CreatedOn = vm.CreatedOn;
            model.ModifiedBy = vm.ModifiedBy;
            model.ModifiedOn = vm.ModifiedOn;        

            return model;
        }

        public static void ToModel(this DeveloperViewModel vm, EF.Developer model)
        { 
            model.Id = vm.Id;
            model.ExperienceValue = vm.ExperienceValue;
            model.DomainAccount = vm.DomainAccount;           
            model.TrueName = vm.TrueName;
            model.NickName = vm.NickName;
            model.GameLevel = vm.GameLevel;
            model.CreatedBy = vm.CreatedBy;
            model.CreatedOn = vm.CreatedOn;
            model.ModifiedBy = vm.ModifiedBy;
            model.ModifiedOn = vm.ModifiedOn;           
        }
    }
}